﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace Antioch.Base
{
	[Jemgine.Engine.Category("Antioch System"), Jemgine.Engine.Component]
	public class PlayerHealth : Health
	{
        public override void TakeDamage(int Damage)
        {
            base.TakeDamage(Damage);

            var GSM = Sim.GetModule<GameStateModule>();
            if (GSM != null && GSM.ActiveSaveState != null)
                GSM.ActiveSaveState.PlayerHealth = this.CurrentHealth;
        }		
	}
}
